package com.tedu.day02.oop;

import java.io.Serializable;

/**
 * 实体类：属性 对应 数据库【字段】
 */
public class Person extends Object implements Serializable {
    public static void main(String[] args) {
        Person p=new Person();
        System.out.println(p.toString()); //打印对象地址值
    }
    private String name; //私有属性
    private int age;
    private char sex;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public char getSex() {
        return sex;
    }

    public void setSex(char sex) {
        this.sex = sex;
    }
    //调取默认构造器：打桩
    public Person() {
        System.out.println("person.....");
    }
    //程序员：toString()   调取--不用手写
    //打印对象，不调取  地址值  数据类型@十六进制值

    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                '}';
    }
}
